package com.bdqn.jpa.repository;

import com.bdqn.jpa.entity.SysUser;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface UserRepository extends JpaRepository<SysUser, Long> , JpaSpecificationExecutor<SysUser> {


    public List<SysUser>findUsersByName(String name);

    @Query("select u from SysUser u where u.usr_role_id=?1")
    public Page<SysUser> findByUsr_role_id(Long usr_role_id, Pageable pageable);
}
